file = open("word.txt")

# print(file.readlines())
# print("=")
# print(file.readlines())

lines = file.readlines()

for line in lines:
    print(line.strip())

slines = [line.strip() for line in lines]

print(slines)

# r 读   a追加  w 覆盖写

f = open("a.txt", "a", encoding="utf-8")
f.write("\n")
f.write("数加学院")
f.flush()
f.close()

print("=" * 100)

#  代码块结束自动关闭流
with open("word.txt") as f:
    print(f.read())
